package com.ruoyi.tt.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.tt.domain.vo.ArticleVO;
import com.ruoyi.tt.service.TtHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author
 * @date 2022/10/22 1:01
 **/
@RestController
@RequestMapping("/tt/history")
public class TtHistoryController {

    @Autowired
    private TtHistoryService historyService;

    @GetMapping("list")
    public AjaxResult list() {
        List<ArticleVO> list = historyService.list();
        return AjaxResult.success(list);
    }

    @GetMapping("save/{articleId}")
    public AjaxResult save(@PathVariable("articleId") Integer articleId) {
        int i = historyService.save(articleId);
        return AjaxResult.success(i);
    }
}
